package com.ruoyi.sys.garden.service.impl;

import java.util.List;

import com.ruoyi.sys.garden.entity.TbAnnouncement;
import com.ruoyi.sys.garden.mapper.TbAnnouncementMapper;
import com.ruoyi.sys.garden.service.ITbAnnouncementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 公告Service业务层处理
 * 
 * @author jinsuo
 * @date 2022-05-24
 */
@Service
public class TbAnnouncementServiceImpl implements ITbAnnouncementService
{
    @Autowired
    private TbAnnouncementMapper tbAnnouncementMapper;

    /**
     * 查询公告
     * 
     * @param aId 公告主键
     * @return 公告
     */
    @Override
    public TbAnnouncement selectTbAnnouncementByAId(Long aId)
    {
        return tbAnnouncementMapper.selectTbAnnouncementByAId(aId);
    }

    /**
     * 查询公告列表
     * 
     * @param tbAnnouncement 公告
     * @return 公告
     */
    @Override
    public List<TbAnnouncement> selectTbAnnouncementList(TbAnnouncement tbAnnouncement)
    {
        return tbAnnouncementMapper.selectTbAnnouncementList(tbAnnouncement);
    }

    /**
     * 新增公告
     * 
     * @param tbAnnouncement 公告
     * @return 结果
     */
    @Override
    public int insertTbAnnouncement(TbAnnouncement tbAnnouncement)
    {
        return tbAnnouncementMapper.insertTbAnnouncement(tbAnnouncement);
    }

    /**
     * 修改公告
     * 
     * @param tbAnnouncement 公告
     * @return 结果
     */
    @Override
    public int updateTbAnnouncement(TbAnnouncement tbAnnouncement)
    {
        return tbAnnouncementMapper.updateTbAnnouncement(tbAnnouncement);
    }

    /**
     * 批量删除公告
     * 
     * @param aIds 需要删除的公告主键
     * @return 结果
     */
    @Override
    public int deleteTbAnnouncementByAIds(Long[] aIds)
    {
        return tbAnnouncementMapper.deleteTbAnnouncementByAIds(aIds);
    }

    /**
     * 删除公告信息
     * 
     * @param aId 公告主键
     * @return 结果
     */
    @Override
    public int deleteTbAnnouncementByAId(Long aId)
    {
        return tbAnnouncementMapper.deleteTbAnnouncementByAId(aId);
    }
}
